package com.design.mall;

import java.util.Scanner;

/**
 * @author by liuxin
 * @version 0.1
 */
public class Client3 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入打折方式（1/2/3）：");
        int in = scanner.nextInt();
        double payPrices = 0;
        System.out.print("请输入单价：");
        double price = scanner.nextDouble();
        System.out.print("请输入数量：");
        double num = scanner.nextDouble();

        double totalPrices = price * num;
        String type = "";

        if (in == 1) {
            payPrices = totalPrices;
            type += "正常收费";
        } else if (in == 2) {
            if (totalPrices >= 300) {
                payPrices = totalPrices - 100;
            }
            type += "满300返100";

        } else if (in == 3) {
            payPrices = totalPrices * 0.8;
            type += "打8折";
        } else {
            System.out.println("请输入1/2/3");
        }

        System.out.println("单价：" + price + "，数量：" + num + "，类型：" + type + "，合计：" + payPrices);

        scanner.close();
    }
}
